From jsahn at connectedsys.com Thu Mar 3 16:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Thu Mar 3 16:50:03 2005 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 16:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu Mar 3 16:56:38 2005 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj@www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj@www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 19:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Mar 3 19:31:19 2005 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 21:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Mar 3 21:55:48 2005 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj@www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 14:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Mar 4 14:39:00 2005 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj@www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 17:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue Mar 8 17:53:33 2005 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary@ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment.htm From taj at www.linux.org.uk Tue Mar 8 21:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 8 21:16:51 2005 Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx@linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 21:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue Mar 8 21:29:08 2005 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx@linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 21:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 8 21:34:36 2005 Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx@linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 14:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed Mar 9 14:46:17 2005 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 16:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed Mar 9 16:20:46 2005 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c.bin From taj at www.linux.org.uk Thu Mar 10 01:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Mar 10 01:13:57 2005 Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj@www.linux.org.uk From mark at panonet.net Thu Mar 10 09:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu Mar 10 09:38:08 2005 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c.bin From taj at www.linux.org.uk Thu Mar 10 12:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Mar 10 12:21:08 2005 Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj@www.linux.org.uk From d.tonhofer at m-plify.com Fri Mar 11 03:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri Mar 11 03:26:24 2005 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Fri Mar 11 03:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Mar 11 03:35:02 2005 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 21:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Mar 11 21:14:37 2005 Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj@www.linux.org.uk From meplists at earthlink.net Sun Mar 13 16:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun Mar 13 16:10:46 2005 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 16:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun Mar 13 16:34:33 2005 Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj@www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 18:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Sun Mar 13 18:10:27 2005 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 11:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon Mar 14 11:55:13 2005 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 17:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Mar 14 17:40:39 2005 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 17:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon Mar 14 17:49:12 2005 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 23:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon Mar 14 22:58:24 2005 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 20:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon Mar 14 23:56:51 2005 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos@pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Tue Mar 15 05:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue Mar 15 05:20:09 2005 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Tue Mar 15 05:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue Mar 15 05:45:37 2005 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Tue Mar 15 06:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 15 06:53:15 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj@www.linux.org.uk From madanthota at gmail.com Tue Mar 15 05:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue Mar 15 06:58:31 2005 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 07:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 15 07:11:23 2005 Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj@www.linux.org.uk From nino at nordman.org Tue Mar 15 07:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue Mar 15 07:46:29 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 23:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Wed Mar 16 23:09:51 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 23:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed Mar 16 23:15:48 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Thu Mar 17 04:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Mar 17 04:05:30 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj@www.linux.org.uk From p.cain at phasefale.com.au Thu Mar 17 05:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu Mar 17 05:14:40 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 14:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu Mar 17 14:45:14 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 14:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu Mar 17 14:50:49 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 16:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Thu Mar 17 18:31:34 2005 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050316/00278648/attachment.htm From p.cain at phasefale.com.au Thu Mar 17 23:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu Mar 17 23:11:49 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 23:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu Mar 17 23:17:01 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build.xml From taj at www.linux.org.uk Fri Mar 18 02:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Mar 18 02:39:27 2005 Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj@www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 07:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri Mar 18 07:01:05 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 07:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue Mar 22 07:06:24 2005 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment.htm From taj at www.linux.org.uk Tue Mar 22 07:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 22 07:32:04 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj@www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 19:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue Mar 22 19:38:46 2005 Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 20:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 22 20:34:39 2005 Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj@www.linux.org.uk From jimo at earthlink.net Wed Mar 23 05:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed Mar 23 05:41:39 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 10:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Mar 23 10:30:51 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj@www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 12:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed Mar 23 12:02:04 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor@opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 12:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Mar 23 12:21:44 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj@www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 16:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed Mar 23 16:27:28 2005 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518@student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 16:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed Mar 23 16:27:32 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 16:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed Mar 23 16:31:25 2005 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518@student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 20:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Mar 23 21:10:51 2005 Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj@www.linux.org.uk From jimo at earthlink.net Fri Mar 25 06:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Fri Mar 25 06:38:11 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 07:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Mar 25 07:25:36 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Sat Mar 26 02:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat Mar 26 02:19:07 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj@www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 16:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri Jun 3 17:47:02 2005 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 16:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 17:47:03 2005 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj@www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj@www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 19:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:03 2005 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 21:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:03 2005 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj@www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 14:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 17:47:03 2005 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj@www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 17:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Fri Jun 3 17:47:03 2005 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary@ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0001.htm From taj at www.linux.org.uk Tue Mar 8 21:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:03 2005 Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx@linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 21:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Fri Jun 3 17:47:03 2005 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx@linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 21:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:03 2005 Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx@linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 14:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 17:47:03 2005 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 16:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Fri Jun 3 17:47:04 2005 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0002.bin From taj at www.linux.org.uk Thu Mar 10 01:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:04 2005 Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj@www.linux.org.uk From mark at panonet.net Thu Mar 10 09:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Fri Jun 3 17:47:04 2005 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0002.bin From taj at www.linux.org.uk Thu Mar 10 12:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:04 2005 Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj@www.linux.org.uk From d.tonhofer at m-plify.com Fri Mar 11 03:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri Jun 3 17:47:04 2005 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Fri Mar 11 03:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:04 2005 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 21:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:04 2005 Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj@www.linux.org.uk From meplists at earthlink.net Sun Mar 13 16:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Fri Jun 3 17:47:04 2005 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 16:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:04 2005 Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj@www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 18:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri Jun 3 17:47:04 2005 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 11:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 17:47:04 2005 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 17:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:04 2005 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 17:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 17:47:04 2005 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 23:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 20:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos@pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Tue Mar 15 05:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Tue Mar 15 05:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Tue Mar 15 06:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj@www.linux.org.uk From madanthota at gmail.com Tue Mar 15 05:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 07:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj@www.linux.org.uk From nino at nordman.org Tue Mar 15 07:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 23:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 23:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Thu Mar 17 04:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj@www.linux.org.uk From p.cain at phasefale.com.au Thu Mar 17 05:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 14:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 14:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 16:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Fri Jun 3 17:47:05 2005 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0001.htm From p.cain at phasefale.com.au Thu Mar 17 23:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri Jun 3 17:47:06 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 23:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri Jun 3 17:47:06 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0002.xml From taj at www.linux.org.uk Fri Mar 18 02:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:06 2005 Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj@www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 07:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri Jun 3 17:47:06 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 07:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Fri Jun 3 17:47:06 2005 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0001.htm From taj at www.linux.org.uk Tue Mar 22 07:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:06 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj@www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 19:40:11 2005 From: bst_co at yahoo.com (bst) Date: Fri Jun 3 17:47:06 2005 Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 20:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:06 2005 Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj@www.linux.org.uk From jimo at earthlink.net Wed Mar 23 05:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Fri Jun 3 17:47:06 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 10:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:06 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj@www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 12:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Fri Jun 3 17:47:06 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor@opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 12:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:07 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj@www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 16:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Fri Jun 3 17:47:07 2005 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518@student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 16:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Fri Jun 3 17:47:07 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 16:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Fri Jun 3 17:47:07 2005 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518@student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 20:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:07 2005 Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj@www.linux.org.uk From jimo at earthlink.net Fri Mar 25 06:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Fri Jun 3 17:47:07 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 07:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:07 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Sat Mar 26 02:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:07 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj@www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 16:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri Jun 3 18:09:26 2005 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 16:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 18:09:26 2005 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj@www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj@www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 19:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:26 2005 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 21:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:26 2005 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj@www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 14:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 18:09:26 2005 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj@www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 17:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Fri Jun 3 18:09:26 2005 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary@ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0002.htm From taj at www.linux.org.uk Tue Mar 8 21:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:26 2005 Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx@linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 21:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Fri Jun 3 18:09:26 2005 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx@linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 21:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:26 2005 Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx@linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 14:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 18:09:26 2005 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 16:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Fri Jun 3 18:09:27 2005 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0003.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0003.bin From taj at www.linux.org.uk Thu Mar 10 01:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:27 2005 Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj@www.linux.org.uk From mark at panonet.net Thu Mar 10 09:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Fri Jun 3 18:09:27 2005 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0003.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0003.bin From taj at www.linux.org.uk Thu Mar 10 12:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:27 2005 Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj@www.linux.org.uk From d.tonhofer at m-plify.com Fri Mar 11 03:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri Jun 3 18:09:27 2005 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Fri Mar 11 03:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:27 2005 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 21:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:27 2005 Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj@www.linux.org.uk From meplists at earthlink.net Sun Mar 13 16:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Fri Jun 3 18:09:27 2005 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 16:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:27 2005 Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj@www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 18:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri Jun 3 18:09:27 2005 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 11:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 18:09:27 2005 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 17:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:27 2005 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 17:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 23:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 20:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos@pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Tue Mar 15 05:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Tue Mar 15 05:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Tue Mar 15 06:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj@www.linux.org.uk From madanthota at gmail.com Tue Mar 15 05:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 07:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj@www.linux.org.uk From nino at nordman.org Tue Mar 15 07:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 23:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 23:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Thu Mar 17 04:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj@www.linux.org.uk From p.cain at phasefale.com.au Thu Mar 17 05:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 14:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 14:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Fri Jun 3 18:09:28 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 16:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Fri Jun 3 18:09:29 2005 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0002.htm From p.cain at phasefale.com.au Thu Mar 17 23:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri Jun 3 18:09:29 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 23:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri Jun 3 18:09:29 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0003.xml From taj at www.linux.org.uk Fri Mar 18 02:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:29 2005 Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj@www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 07:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri Jun 3 18:09:29 2005 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 07:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Fri Jun 3 18:09:29 2005 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0002.htm From taj at www.linux.org.uk Tue Mar 22 07:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:29 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj@www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 19:40:11 2005 From: bst_co at yahoo.com (bst) Date: Fri Jun 3 18:09:29 2005 Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 20:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:29 2005 Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj@www.linux.org.uk From jimo at earthlink.net Wed Mar 23 05:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Fri Jun 3 18:09:29 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 10:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:29 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj@www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 12:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Fri Jun 3 18:09:30 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor@opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 12:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:30 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj@www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 16:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Fri Jun 3 18:09:30 2005 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518@student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 16:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Fri Jun 3 18:09:30 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 16:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Fri Jun 3 18:09:30 2005 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518@student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 20:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:30 2005 Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj@www.linux.org.uk From jimo at earthlink.net Fri Mar 25 06:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Fri Jun 3 18:09:30 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 07:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:30 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Sat Mar 26 02:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:30 2005 Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj@www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0395.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0395.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0395.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0395.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0395.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0395.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0395.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0395.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0396.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0396.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0396.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0396.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0396.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0396.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0396.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0396.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0397.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0397.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0397.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0397.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0397.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0397.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0397.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0397.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0398.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0398.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0398.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0398.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0398.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0398.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0398.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0398.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0399.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0399.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0399.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0399.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0399.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0399.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0399.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0399.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0400.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0400.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0400.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0400.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0400.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0400.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0400.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0400.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0401.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0401.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0401.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0401.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0401.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0401.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0401.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0401.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0402.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0402.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0402.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0402.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0402.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0402.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0402.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0402.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0403.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0403.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0403.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0403.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0403.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0403.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0403.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0403.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0404.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0404.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0404.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0404.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0404.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0404.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0404.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0404.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0001.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0001.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0001.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0001.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0001.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0001.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0002.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0002.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0002.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0002.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0002.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0002.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0003.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0003.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0003.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0003.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0003.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0003.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0003.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0003.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0004.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0004.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0004.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0004.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0004.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0004.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0004.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0004.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0005.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0005.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0005.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0005.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0005.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0005.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0005.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0005.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0006.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0006.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0006.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0006.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0006.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0006.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0006.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0006.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0007.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0007.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0007.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0007.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0007.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0007.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0007.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0007.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0008.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0008.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0008.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0008.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0008.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0008.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0008.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0008.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0009.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0009.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0009.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0009.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0009.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0009.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0009.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0009.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0010.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0010.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0010.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0010.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0010.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0010.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0010.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0010.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0001.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0001.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0001.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0001.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0001.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0001.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0002.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0002.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0002.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0002.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0002.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0002.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0003.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0003.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0003.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0003.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0003.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0003.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0003.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0003.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0004.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0004.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0004.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0004.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0004.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0004.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0004.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0004.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0005.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0005.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0005.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0005.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0005.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0005.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0005.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0005.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0006.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0006.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0006.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0006.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0006.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0006.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0006.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0006.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0007.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0007.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0007.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0007.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0007.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0007.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0007.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0007.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0008.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0008.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0008.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0008.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0008.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0008.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0008.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0008.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0009.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0009.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0009.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0009.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0009.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0009.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0009.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0009.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0010.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0010.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0010.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0010.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0010.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0010.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0010.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0010.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0001.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0001.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0001.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0001.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0001.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0001.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0002.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0002.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0002.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0002.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0002.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0002.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0003.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0003.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0003.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0003.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0003.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0003.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0003.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0003.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0004.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0004.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0004.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0004.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0004.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0004.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0004.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0004.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0005.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0005.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0005.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0005.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0005.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0005.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0005.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0005.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0006.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0006.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0006.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0006.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0006.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0006.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0006.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0006.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0007.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0007.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0007.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0007.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0007.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0007.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0007.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0007.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0008.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0008.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0008.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0008.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0008.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0008.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050317/2fd0fce6/build-0008.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050322/b8f8b4f3/attachment-0008.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0009.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0009.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0009.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0009.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0009.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0009.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0010.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0010.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0010.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0010.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0010.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0010.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0001.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0001.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0011.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0011.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0011.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0011.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0011.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0011.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0002.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0002.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0012.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0012.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0012.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0012.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0012.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0012.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0003.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0003.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0013.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0013.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0013.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0013.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0013.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0013.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0004.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0004.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0014.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0014.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0014.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0014.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0014.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0014.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0005.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0005.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0015.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0015.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0015.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0015.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0015.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0015.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0006.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0006.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0016.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0016.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0016.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0016.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0016.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0016.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0007.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0007.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0017.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0017.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0017.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0017.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0017.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0017.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0008.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0008.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0018.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0018.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0018.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0018.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0018.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0018.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0009.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0009.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0019.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0019.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0019.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0019.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0019.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0019.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0010.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0010.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0020.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0020.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0020.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0020.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0020.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0020.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0011.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0011.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0021.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0021.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0021.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0021.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0021.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0021.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0012.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0012.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0022.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0022.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0022.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0022.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0022.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0022.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0013.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0013.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought there was a problem with making > it > work for some reason. I've now forgotten why. > > I'll look at it again. Did you get it to work on the various OS's? > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From allen.geary at ndchealth.com Tue Mar 8 10:56:06 2005 From: allen.geary at ndchealth.com (Geary, Allen # Pittsburgh) Date: Tue, 8 Mar 2005 12:56:06 -0500 Subject: [Rxtx] Can't find any serial ports... Message-ID: Hi, I am trying to get RXTX to work under RedHat linux. When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException. I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum. I read through the archives and found the information about belonging to the uucp group and I took care of that. I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know. How can I get these ports to show up in RXTX? Thanks Allen allen.geary at ndchealth.com This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050308/21ee9644/attachment-0023.html From taj at www.linux.org.uk Tue Mar 8 14:19:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:19:33 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... Message-ID: Date: Tue, 8 Mar 2005 15:51:30 -0500 From: Allen Geary Jr To: rxtx at linuxgrrls.org Subject: Can't find any serial ports... Hi, I am trying to get RXTX to work under RedHat linux.\uffff When I make the call to getPortIdentifier() using /dev/ttyS0 I get an error stating NoSuchPortException.\uffff I then tried pulling an enumeration back via CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the enum.\uffff I read through the archives and found the information about belonging to the uucp group and I took care of that.\uffff I also verified that I can cat /dev/ttyS0 from the command line and read data from the serial device so I have access as far as I know.\uffff How can I get these ports to show up in RXTX? Thanks Allen Hi Allen The group you need to add this to on Redhat is probably group lock. ls -ld /var/lock/ ls -l /dev/ttyS* You need to be able to create and deltee files in lock. The group ownership is not specified by any standard. You also need to be able to write to the ttyS* files. I suspect if you try the application as root, it will have permissions and will work. From allengeary_jr at hotmail.com Tue Mar 8 14:31:32 2005 From: allengeary_jr at hotmail.com (Allen Geary Jr) Date: Tue, 8 Mar 2005 16:31:32 -0500 Subject: Re [Rxtx] Can't find any serial ports... References: Message-ID: OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get the same problem. Any suggestions? Allen ----- Original Message ----- From: "Trent Jarvi" To: "Java RXTX discussion" Cc: Sent: Tuesday, March 08, 2005 4:19 PM Subject: Re [Rxtx] Can't find any serial ports... > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > From: Allen Geary Jr > To: rxtx at linuxgrrls.org > Subject: Can't find any serial ports... > > > Hi, > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > call > to getPortIdentifier() using /dev/ttyS0 I get an error stating > NoSuchPortException.\uffff I then tried pulling an enumeration back via > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > enum.\uffff I read through the archives and found the information about > belonging to the uucp group and I took care of that.\uffff I also verified > that I can cat /dev/ttyS0 from the command line and read data from the > serial device so I have access as far as I know.\uffff How can I get these > ports to show up in RXTX? > > Thanks > Allen > > Hi Allen > > The group you need to add this to on Redhat is probably group lock. > > ls -ld /var/lock/ > ls -l /dev/ttyS* > > You need to be able to create and deltee files in lock. The group > ownership is not specified by any standard. You also need to be able to > write to the ttyS* files. > > I suspect if you try the application as root, it will have permissions and > will work. > From taj at www.linux.org.uk Tue Mar 8 14:37:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Mar 2005 21:37:10 +0000 (GMT) Subject: Re [Rxtx] Can't find any serial ports... In-Reply-To: References: Message-ID: On Tue, 8 Mar 2005, Allen Geary Jr wrote: > OK, just for now, I chmod /var/lock to 777. Same with ttyS*. I still get > the same problem. Any suggestions? > > Allen > You need to log out as the user and log back in as I recall. then test: touch /var/lock/myfilename && rm -f /var/lock/myfilename If that works and no ports are found it is a permission problem with the port or the port is already locked by a running application. > > ----- Original Message ----- > From: "Trent Jarvi" > To: "Java RXTX discussion" > Cc: > Sent: Tuesday, March 08, 2005 4:19 PM > Subject: Re [Rxtx] Can't find any serial ports... > > > > > > > > Date: Tue, 8 Mar 2005 15:51:30 -0500 > > From: Allen Geary Jr > > To: rxtx at linuxgrrls.org > > Subject: Can't find any serial ports... > > > > > > Hi, > > > > I am trying to get RXTX to work under RedHat linux.\uffff When I make the > > call > > to getPortIdentifier() using /dev/ttyS0 I get an error stating > > NoSuchPortException.\uffff I then tried pulling an enumeration back via > > CommPortIdentifier.getPortIdentifiers() and I do not get any ports in the > > enum.\uffff I read through the archives and found the information about > > belonging to the uucp group and I took care of that.\uffff I also verified > > that I can cat /dev/ttyS0 from the command line and read data from the > > serial device so I have access as far as I know.\uffff How can I get these > > ports to show up in RXTX? > > > > Thanks > > Allen > > > > Hi Allen > > > > The group you need to add this to on Redhat is probably group lock. > > > > ls -ld /var/lock/ > > ls -l /dev/ttyS* > > > > You need to be able to create and deltee files in lock. The group > > ownership is not specified by any standard. You also need to be able to > > write to the ttyS* files. > > > > I suspect if you try the application as root, it will have permissions and > > will work. > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Wed Mar 9 07:49:13 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Wed, 9 Mar 2005 16:49:13 +0200 Subject: [Rxtx] Retreiving a SMS from a GSM modem Message-ID: <200503091649.13882.waynetg@telkomsa.net> Hi all I'm trying to find out the best way to retrieve an SMS from a GSM modem. At the moment I'm setting the modem into text mode and retrieving the messages using the serialEvent as the modem outputs the info. The problem I am having is that one event doesn't contain a whole SMS and its very hard to track the start of one sms and the finish of another. I'm also a bit concerned about multiple sms's getting mixed up if they arrive at the same time. Any comments on this? Regards Wayne Gemmell From mark at panonet.net Wed Mar 9 09:23:00 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 9 Mar 2005 16:23:00 +0000 Subject: [Rxtx] CNI Patch Message-ID: <200503091623.00753.mark@panonet.net> There is an issue with the CNI implementation where it does not use the correct file descriptor for writing data to the serial port. The issue is in the native implementation of RXTXPort.writeByte. It uses this-fd which gives the wrong value. The attached patch passes in the file descriptor as an argument to writeByte. Also in this patch I have added a couple of if (debug) statements that seemed to be missing in RXTXPort. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 1407 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.RXTXPort.java-0023.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 572 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050309/041644ab/rxtx.cni.SerialImp.c-0023.bin From taj at www.linux.org.uk Wed Mar 9 18:16:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 01:16:53 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503091623.00753.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> Message-ID: On Wed, 9 Mar 2005, Mark Anderson wrote: > There is an issue with the CNI implementation where it does not use the > correct file descriptor for writing data to the serial port. > > The issue is in the native implementation of RXTXPort.writeByte. It uses > this-fd which gives the wrong value. The attached patch passes in the file > descriptor as an argument to writeByte. > > Also in this patch I have added a couple of if (debug) statements that seemed > to be missing in RXTXPort. > > With the file descriptor, wont just changing: int fd = ( int ) this-fd; to int fd = ( int ) this->fd; Solve the problem? I think thats just a typo as reads are doing the same thing. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Thu Mar 10 02:40:34 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 10 Mar 2005 09:40:34 +0000 Subject: [Rxtx] CNI Patch In-Reply-To: References: <200503091623.00753.mark@panonet.net> Message-ID: <200503100940.34268.mark@panonet.net> On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > On Wed, 9 Mar 2005, Mark Anderson wrote: > > There is an issue with the CNI implementation where it does not use the > > correct file descriptor for writing data to the serial port. > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > this-fd which gives the wrong value. The attached patch passes in the > > file descriptor as an argument to writeByte. > > > > Also in this patch I have added a couple of if (debug) statements that > > seemed to be missing in RXTXPort. > > With the file descriptor, wont just changing: > > int fd = ( int ) this-fd; > > to > > int fd = ( int ) this->fd; > > Solve the problem? I think thats just a typo as reads are doing the same > thing. Yes that does it. Have redone the patches for this and for RXTXPort to only fix the missing if (debug) statements. -- Regards, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.RXTXPort.java.patch Type: text/x-diff Size: 694 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.RXTXPort.java-0023.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.cni.SerialImp.c.patch Type: text/x-diff Size: 373 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050310/e6e60ff7/rxtx.cni.SerialImp.c-0023.bin From taj at www.linux.org.uk Thu Mar 10 05:24:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Mar 2005 12:24:12 +0000 (GMT) Subject: [Rxtx] CNI Patch In-Reply-To: <200503100940.34268.mark@panonet.net> References: <200503091623.00753.mark@panonet.net> <200503100940.34268.mark@panonet.net> Message-ID: On Thu, 10 Mar 2005, Mark Anderson wrote: > On Thursday 10 March 2005 01:16, Trent Jarvi wrote: > > On Wed, 9 Mar 2005, Mark Anderson wrote: > > > There is an issue with the CNI implementation where it does not use the > > > correct file descriptor for writing data to the serial port. > > > > > > The issue is in the native implementation of RXTXPort.writeByte. It uses > > > this-fd which gives the wrong value. The attached patch passes in the > > > file descriptor as an argument to writeByte. > > > > > > Also in this patch I have added a couple of if (debug) statements that > > > seemed to be missing in RXTXPort. > > > > With the file descriptor, wont just changing: > > > > int fd = ( int ) this-fd; > > > > to > > > > int fd = ( int ) this->fd; > > > > Solve the problem? I think thats just a typo as reads are doing the same > > thing. > > Yes that does it. Have redone the patches for this and for RXTXPort to only > fix the missing if (debug) statements. > > Thanks Mark, These are in CVS now. -- Trent Jarvi taj at www.linux.org.uk From d.tonhofer at m-plify.com Thu Mar 10 20:30:20 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 11 Mar 2005 04:30:20 +0100 Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever Message-ID: Hello, Just a quick question: I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to return - or does not return at all. This is new as I never had that problem with 2.1.6 in 32-bit mode, where RXTX behaved like a charm (*kiss*). So, before I fire up strace and stuff, would anyone maybe know where to look to solve this? Best regards, -- David From taj at www.linux.org.uk Thu Mar 10 20:38:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 03:38:15 +0000 (GMT) Subject: [Rxtx] Hmmm.....gnu.io.CommPort.close() waits for a long time or forever In-Reply-To: References: Message-ID: On Fri, 11 Mar 2005, David Tonhofer, m-plify S.A. wrote: > Hello, > > Just a quick question: > > I have encountered a snafu with the latest RXTX, rxtx-2.1-CVS-20050120, > used from a Java program running on Sun's jdk1.5.0_02 for AMD64, the > whole on top of a 2.6.9-5.0.3 Linux kernel with two EM64T Xeons underneath. > > Put simply: gnu.io.CommPort.close() takes a *long* time (a minute) to > return - or does not return at all. > > This is new as I never had that problem with 2.1.6 in 32-bit mode, where > RXTX behaved like a charm (*kiss*). > > So, before I fire up strace and stuff, would anyone maybe know where to > look to solve this? > > Best regards, > Hi David Try adding an event listener after open. The close code gets confused when there is no event listener. It waits for the event listener to shut down and behaves like you mention. I think thats whats going on and its probably fairly easy to sit down and figure out a way to get past that inside rxtx. As it is now I just docmented it as a known issue on the front page of rxtx. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 11 14:17:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 11 Mar 2005 21:17:54 +0000 (GMT) Subject: [Rxtx] Re: Proxy Error on mailinglist from rxtx / Set TxD? In-Reply-To: <200503112117.44719.vivp@gmx.de> References: <200502261119.10163.vivp@gmx.de> <200502261527.49586.vivp@gmx.de> <200503112117.44719.vivp@gmx.de> Message-ID: I've cc'd the rxtx mail-list. When you reply I'll take care of the mailman issues. On Fri, 11 Mar 2005, vivp wrote: > Hi Trent, > > I change my hardware, because the setTxD isn't ready, so I thought that's the > solution for my problem. But now the problem with rxtx is: I need > setDTR(false), setRTS(true) and setRTS(false). If I set the RTS the DTR is > change, but I can't use a change of DTR. This part I dont fully understand. Could you comment just the part of your code that tries to do the above? Just the 4 lines of code or so you are trying. > > I search in the mailinglist, but I don't found a solution. > I can't find the connection between the RTS and DTR. Ok, in the register of > the uart > OUT (BA + 4), 1 * DTR = 1, RTS = 0 > OUT (BA + 4), 2 * DTR = 0, RTS = 1 > OUT (BA + 4), 3 * DTR = 1, RTS = 1 > OUT (BA + 4), 0 * DTR = 0, RTS = 0 > but not in the SerialImp.c. I think I need > OUT (BA + 4), 1 and OUT (BA + 4), 3 in place of > OUT (BA + 4), 2 and OUT (BA + 4), 0 > but where I can change that? The way rxtx does this is through the API provided by the OS. W32 as I recall in your case. The exact code that does this is in termios.c the function is called ioctl() and the case is: TIOCMGET: (for getting the RTS/DTR) TIOCMSET: (for setting the RTS/DTR) These are called from setDTR and setRTS in SerialImp.c. You may examine the logic there. We dont write to the Base Address + 4 on the UART, The OS API handles that. I'm not sure what you mean by: "without a \uffffp or uart" below. Is there something unusual about your port? Perhaps you have run into a kernel driver problem. Do standard ports behave? Are you locking at the actual signal comming out of the port or trusting software to tell you what is going on? > > If there a simple methodeJ to realise a standard protocol without a ?p or uart, > I forget this all. > > Sorry for my stupid questions and my bad english. > > Thanks in advance and the best wishes > > Axel > > > > > > > > I'm leaving ?town for a couple days but we can try this when I get back. ? > > I have no idea if it will work or not. ?You should be able to compile > > those examples and see if they change the TxD. ?If it works, we will be > > able to do it in rxtx. > > > > The inport, output stuff may be specific for windows95. ?Thats not really > > using the API but trying to write to the UART directly. > > > > On Sat, 26 Feb 2005, vivp wrote: > > > Hello Trent, > > > > > > thanks for your very fast a > -- Trent Jarvi taj at www.linux.org.uk From meplists at earthlink.net Sun Mar 13 09:14:38 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Sun, 13 Mar 2005 11:14:38 -0500 Subject: [Rxtx] Portability of RXTXcomm.jar? Message-ID: <423466EE.1080407@earthlink.net> I'm building an application that needs to run on Linux and Windows. I've picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. Is the RXTXcomm.jar essentially the same for both platforms? That is, can I build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? Of course I want to build just once and deploy to multiple platforms -- Linux and Windows right now, probably MacOS in the future. I have done just that and it seems to be working on both Linux and Windows, but I'd like to get an expert opinion. -- Mark From taj at www.linux.org.uk Sun Mar 13 09:38:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 13 Mar 2005 16:38:27 +0000 (GMT) Subject: [Rxtx] Portability of RXTXcomm.jar? In-Reply-To: <423466EE.1080407@earthlink.net> References: <423466EE.1080407@earthlink.net> Message-ID: On Sun, 13 Mar 2005, Mark Polhamus wrote: > I'm building an application that needs to run on Linux and Windows. I've > picked up the binary packages for 2.1 (rxtx-2.1-7pre17) for both platforms. > > Is the RXTXcomm.jar essentially the same for both platforms? That is, can I > build with the Linux RXTXcomm.jar in my classpath and deploy just the Linux > RXTXcomm.jar along with the native libraries (.so/.dll) for both platforms? > Of course I want to build just once and deploy to multiple platforms -- Linux > and Windows right now, probably MacOS in the future. > > I have done just that and it seems to be working on both Linux and Windows, > but I'd like to get an expert opinion. > > Hi Mark The same jar should work on all the mentioned OSs. The only thing you want to watch is compiling with newer javac versions may not work in older JREs. You will want to verify the jar works with the intended JRE versions. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Sun Mar 13 11:15:14 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 14 Mar 2005 03:15:14 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: References: <422740C1.4070902@connectedsys.com> Message-ID: <42348332.6000601@connectedsys.com> I use cross compiler for MIPS with RXTX 2.1 pre 7 After ./configure , I modify Makefile (I'm not friend with autoconf :) Simply modify tool path CC, GCC, AS, NM, AR... in Makefile and make. after make, librxtxSerial.* librxtxPararel*, and RXTXComm.jar are exist and some error. but, serial(librxtxSerial) work well on my MIPS(AMD AU1550) board. Thanks you Trent Jarvi wrote: >On Fri, 4 Mar 2005, Jisung, Ahn wrote: > > > >>I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . >> >>COMM within J9 is horrible. It miss data!!! >> >>Was RXTX ported on MIPS32? >> >>Is there MIPS 32 RXTX references? >> >> >> > >I'm sure this can work but how do you normally build C programs for your >MIPS system? > >Is the compiler on the mips machine or do you cross compile? > >I have a openwrt wireless box with mips that uses a cross tool chain >because it really does not have the space for anything. Is this what you >do too? There are many linux systems like this that can work but just >need tinkering to build. MIPS, ARM, ... > >If you are trying to build on the system, email me a typescript of the >configure and make output off the list and I can then fix any problems >with he build. It may even just work though I suspect I need to see that >configure output to see how J9 reports itself. > > > From waynetg at telkomsa.net Mon Mar 14 04:59:06 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 13:59:06 +0200 Subject: [Rxtx] SerialEvent stops sending events Message-ID: <200503141359.06894.waynetg@telkomsa.net> Hi all I've got a weird problem. I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM modem to process incoming SMSs. For about half an hour it sits processing the inputs and eventually it just stops receiving event notifications. I can connect to the source of the smss and it is still sending, I can connect to the receiver (after stopping my program) and it is still outputting info but my program just sits there... Are there any known issues with this? Anyone had similar problems? Cheers Wayne From taj at www.linux.org.uk Mon Mar 14 10:44:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 14 Mar 2005 17:44:45 +0000 (GMT) Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141359.06894.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: On Mon, 14 Mar 2005, Wayne Gemmell wrote: > Hi all > > I've got a weird problem. > I use SerialPortEvent.DATA_AVAILABLE to notify me of incoming info into my GSM > modem to process incoming SMSs. For about half an hour it sits processing the > inputs and eventually it just stops receiving event notifications. I can > connect to the source of the smss and it is still sending, I can connect to > the receiver (after stopping my program) and it is still outputting info but > my program just sits there... Are there any known issues with this? Anyone > had similar problems? > Hi Wayne I assume you are using the 2.0 or 2.1 CVS tarballs on http://www.rxtx.org/download.html. I've not seen this but would suspect Java is running out of resources. Maybe something like you are creating a new thread/object on each event and they are not exiting or getting garbage collected. I would try a different JRE version. The native threading in Linux has undergone many improvements. It is my suspicion that the JREs and glibc get a bit out of sync from time to time as these improvments take place. Try to match the system specifications (glibc and kernel) that the JRE is released for. Also you might try stubbing your event handler to see if the problem is in your code or something outside of your code (rxtx,jre,..). -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Mon Mar 14 10:53:24 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Mon, 14 Mar 2005 19:53:24 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: References: <200503141359.06894.waynetg@telkomsa.net> Message-ID: <200503141953.24939.waynetg@telkomsa.net> On Monday 14 March 2005 19:44, Trent Jarvi wrote: > I assume you are using the 2.0 or 2.1 CVS tarballs on > http://www.rxtx.org/download.html. Yes, the ones you mailed me last month. > > I've not seen this but would suspect Java is running out of resources. ? > Maybe something like you are creating a new thread/object on each event > and they are not exiting or getting garbage collected. > > I would try a different JRE version. ?The native threading in Linux has > undergone many improvements. ?It is my suspicion that the JREs and glibc > get a bit out of sync from time to time as these improvments take place. > Try to match the system specifications (glibc and kernel) that the JRE is > released for. I'm running sunjdk_1.4.07. I'll look into your suggestions. > > Also you might try stubbing your event handler to see if the problem is in > your code or something outside of your code (rxtx,jre,..). I have a log file that logs all characters that are read before processing them as such i=inputStream.read(); try { fw = new FileWriter(log,true); fw.write((char) i); fw.close(); } catch (IOException e1) { e1.printStackTrace(); } All activity stops at the same time. Is that what you meant? I have so far ruled out the modem as a cause as well as my sending unit. I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Cheers Wayne From waynetg at telkomsa.net Mon Mar 14 16:02:41 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 01:02:41 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503141953.24939.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> Message-ID: <200503150102.41734.waynetg@telkomsa.net> On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > I have so far ruled out the modem as a cause as well as my sending unit. > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) Ok, time for bed :) I've done more testing using simpleRead and got similar results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth of input and then nothing. I'm running the modem through minicom for the next 5 or 6 hours to rule it out totally. I'm running out of ideas here, any would be appreciated. Cheers Wayne From no_spam at somewhere.com Mon Mar 14 13:59:25 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Mon, 14 Mar 2005 15:59:25 -0500 Subject: [Rxtx] Closing a port from an event listener results in a deadlock. Message-ID: <200503142059.j2EKxPD4030857@host6.oneononeinternet.com> Dear RXTX, I'm using RXTX-2.1-7pre20 and ran into this issue. I found this is caused by the native code waiting for the sendEvent to return. the whole call loop is: serialEvent -> removeEventListener -> monThread.run() -> eventLoop -> report_serial_events -> send_event -> sendEvent -> ... I made some changes to RXTXPort.java to make it works. Is seems to work ok so far, so if someone want to test extensively or give some feedback ... 720c720 < SerialPortEvent e = new SerialPortEvent(this, event, !state, --- > final SerialPortEvent e = new SerialPortEvent(this, event, !state, 732c732,736 < SPEventListener.serialEvent( e ); --- > //execute SPEventListener.serialEvent(e) in its own thread > (new Thread > (new Runnable() > {public void run() {SPEventListener.serialEvent(e);}})) > .start(); -Darth Vader If you would like to reply to this message click the link below, or copy and paste this link into your Web browser's address line: http://www.pcgraffiti.com/anonymous-remailer.php?id=10077&v=14200535924241424 ---------------------------------------- F.Y.I. Someone you know has sent you this anonymous email via PC Graffiti.com. Your email address has not been added to a spam list or advertisment mail list, and you will not receive any mail directly from PC Graffit.com unless requested. This free anonymous email service is intended for entertainment purposes only. If you feel that this site/anonymous email is being abused in any way, please email tos at pcgraffiti.com. To send someone anonymous email go to: http://www.pcgraffiti.com/anonymous-email.htm From waynetg at telkomsa.net Mon Mar 14 22:24:34 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 15 Mar 2005 07:24:34 +0200 Subject: [Rxtx] SerialEvent stops sending events In-Reply-To: <200503150102.41734.waynetg@telkomsa.net> References: <200503141359.06894.waynetg@telkomsa.net> <200503141953.24939.waynetg@telkomsa.net> <200503150102.41734.waynetg@telkomsa.net> Message-ID: <200503150724.34305.waynetg@telkomsa.net> On Tuesday 15 March 2005 01:02, Wayne Gemmell wrote: > On Monday 14 March 2005 19:53, Wayne Gemmell wrote: > > I have so far ruled out the modem as a cause as well as my sending unit. > > I'm just compiling blackbox to see if I can rule out rxtx (gnu.io.*) > > Ok, time for bed :) I've done more testing using simpleRead and got similar > results under blackdown jdk 1.4.2_01 and sun 1.4.2_07. About one hour worth > of input and then nothing. I'm running the modem through minicom for the > next 5 or 6 hours to rule it out totally. I'm running out of ideas here, > any would be appreciated. Em, I left it running with only minicom on the modem and eventually the same thing happens, so I guess its off to buy a new modem.... Sorry to bug you all and thanks for the reply. Cheers Wayne From p.cain at phasefale.com.au Mon Mar 14 22:49:49 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 15 Mar 2005 16:49:49 +1100 Subject: [Rxtx] RXTX Bundling Message-ID: <4236777D.2040306@phasefale.com.au> Hi, I'm in the process of putting together an Ant script to automate the process or bundling the gnu.io.*classes and linux and windows librarys into one jar. At the moment the script downloads the binaries from the rxtx site extracts them, shuffles the files around and makes a new jar. The issue I have is with the library loading. The LibLoader code was floating around on the list last year and recently there has been a patch for "Libraries on Classpath". Has a decision/consensus be formed on the best way to do this ? If not, I'm happy to provide two Ant tasks one of which that will put LibLoader.class into the jar, provided LibLoader.java can be placed in a known location. As far as I can tell it doesn't have a home (either cvs, http or ftp). Pete Cain From taj at www.linux.org.uk Mon Mar 14 23:57:31 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 06:57:31 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4236777D.2040306@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> Message-ID: On Tue, 15 Mar 2005, Peter Cain wrote: > Hi, > > I'm in the process of putting together an Ant script to automate the > process or bundling the gnu.io.*classes and linux and windows librarys > into one jar. At the moment the script downloads the binaries from the > rxtx site extracts them, shuffles the files around and makes a new jar. > > The issue I have is with the library loading. The LibLoader code was > floating around on the list last year and recently there has been a > patch for "Libraries on Classpath". Has a decision/consensus be formed > on the best way to do this ? > > If not, I'm happy to provide two Ant tasks one of which that will put > LibLoader.class into the jar, provided LibLoader.java can be placed in a > known location. As far as I can tell it doesn't have a home (either cvs, > http or ftp). > Hi Peter I have been looking at this too. I wouldnt mind opening this up for discussion. The patch is currently at http://www.linux.org.uk/~taj/LibLoader.java I'm really nervous about the patch. Its writing, blindly loading, executing and deleting the library files from what I assume is a public temporary directory on the system in a fashion thats transparent to the user. Everything about that just sends flags off here saying don't do that. The worst thing rxtx could do is cause harm or be a tool used to cause harm on a users system. Loading libraries from temporary public directories could fit in the later. For instance, it wouldnt be too hard to write a 500 byte library that does bad things and have a program waiting for a chance to overwrite the library with the following resulting in the code being executed at an elevated privilage level or as another user. File fd = null; String tmppath = System.getProperty("java.io.tmpdir"); if (sysName.toLowerCase().indexOf("windows") != -1 && sysName.toLowerCase().indexOf("ce") != -1 && (tmppath == null || tmppath.endsWith("null"))) tmppath = File.separator + "Temp"; while (fd == null) { try { do { int count = (int)(100000f * Math.random()); fd = new File (tmppath, "" + count); } while (fd.exists()); } catch (Exception e) { e.printStackTrace(); System.err.println ("Writing of temp lib-file failed " + fd.getAbsolutePath()); } } String path = fd.getAbsolutePath(); fd.delete(); final File f = new File(path); f.mkdirs(); final File f2 = new File (f, libName); FileOutputStream fos = new FileOutputStream (f2); byte[] b = new byte[1000]; int len; while ((len = is.read(b)) >= 0) { fos.write(b, 0, len); } fos.close(); try { System.load(f2.getAbsolutePath()); } catch (UnsatisfiedLinkError e) { System.out.println ("Could not find own library " + name + ". Will try from ld.library.path"); System.loadLibrary(name); } Runnable r = new Runnable() { public void run() { boolean delf1 = f2.delete(); boolean delf2 = f.delete(); } }; try { Runtime.getRuntime().addShutdownHook(new Thread (r)); } catch (NoSuchMethodError e3) { try { f2.deleteOnExit(); f.deleteOnExit(); } catch (Throwable e) { } } } This is the code I looked at last year and again now. There has to be a more secure way of doing that. -- Trent Jarvi taj at www.linux.org.uk From madanthota at gmail.com Mon Mar 14 22:42:56 2005 From: madanthota at gmail.com (madan naidu) Date: Tue, 15 Mar 2005 11:12:56 +0530 Subject: [Rxtx] blackbox error Message-ID: <583150fc05031421421d44d521@mail.gmail.com> i installed commapi and rxtx accroding to instuctions in rxtx site. but when i ran the BlackBox it is giving me this exception. --- An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 . . . .etc Solution pls. -- From taj at www.linux.org.uk Tue Mar 15 00:15:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Mar 2005 07:15:41 +0000 (GMT) Subject: [Rxtx] blackbox error In-Reply-To: <583150fc05031421421d44d521@mail.gmail.com> References: <583150fc05031421421d44d521@mail.gmail.com> Message-ID: On Tue, 15 Mar 2005, madan naidu wrote: > i installed commapi and rxtx accroding to instuctions in rxtx site. > but when i ran the BlackBox > it is giving me this exception. > --- > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > . > . > . > .etc > There could be many causes. Some things I would try to do: 1) Find out what kernel and glibc the JRE was tested with and match that as close as possible on your system. You dont want the latest and greatest "-mm" "-ac" or other kernels, you want one that the JRE has been tested with. 2) If you downloaded a precompiled binary, try compiling rxtx from source after the above. Things that could be happening that are not common but have shown up before are things like data structure sizes change or do not match from include files (so recompile on your system) or on more experimental kernels, they just break java :) (so match your jre with the right glibc and kernel). If your jre is older and you have a newer system, try to get the newer jre. -- Trent Jarvi taj at www.linux.org.uk From nino at nordman.org Tue Mar 15 00:49:18 2005 From: nino at nordman.org (Nils Nordman) Date: Tue, 15 Mar 2005 08:49:18 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <20050315074918.GA19378@resourcing.se> On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. I'll second that sentiment. It adds a non-trivial amount of complexity and, as you point out, could easily introduce security issues (tmp-races, etc). And for what? Is it really that hard or cumbersome to 1) Install it as an system-wide extension 2) Manipulate java.library.path (this can easily be done with "java -Djava.library.path=", and thus doesn't require superuser access contrary to what some people seem to think). In conclusion, given that it's possible to deploy and use rxtx without superuser privileges, I really don't see why this patch should be included considering its security implications. -- Nils Nordman From p.cain at phasefale.com.au Wed Mar 16 16:09:44 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 10:09:44 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050315074918.GA19378@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> Message-ID: <4238BCB8.7000504@phasefale.com.au> Nils Nordman wrote: >On Tue, Mar 15, 2005 at 06:57:31AM +0000, Trent Jarvi wrote: > > >>I'm really nervous about the patch. Its writing, blindly loading, >>executing and deleting the library files from what I assume is a public >>temporary directory on the system in a fashion thats transparent to the >>user. Everything about that just sends flags off here saying don't do >>that. >> >> > >I'll second that sentiment. It adds a non-trivial amount of complexity >and, as you point out, could easily introduce security issues >(tmp-races, etc). And for what? Is it really that hard or cumbersome to > >1) Install it as an system-wide extension > >2) Manipulate java.library.path (this can easily be done with "java >-Djava.library.path=", and thus doesn't require superuser access >contrary to what some people seem to think). > >In conclusion, given that it's possible to deploy and use rxtx without >superuser privileges, I really don't see why this patch should be >included considering its security implications. > > > Ok I accept the point that loading the library from a tmp dir has issues and probably shouldn't' be used in its current form. However I'd like to point out that there are some reasons why a "LibLoader" type solution is attractive. 1. One jar has cross platform functionality. This is especially attractive in my situation as the app gets used on both Linux and w32. Generally it would make rxtx neat package and could take some of the chore out of building binaries. Possibly even reduce the support load on the list. 2. Its not always possible to perform system wide installations. Applications using rxtx may not always be installed by a skilled user or one with 'super user' type permissions. 3. Command line modification of properties becomes messy on some platforms. For instance w32, you loose the ability to just double click on a jar. Basically this type of solution removes most of the steps to the installation of rxtx, making it easier to use and deploy. It also that it makes the deployment more robust in a cross platform context. None of the reasons justify introducing security issues. But I don't see the possible extra complexity would justify not going with a "LibLoader" type solution, considering it wouldn't really affect the core functionality of the library. -- Peter Cain Senior Programmer Phasefale Pty Ltd From meplists at earthlink.net Wed Mar 16 16:15:47 2005 From: meplists at earthlink.net (Mark Polhamus) Date: Wed, 16 Mar 2005 18:15:47 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> Message-ID: <4238BE23.6050107@earthlink.net> Trent Jarvi wrote: > I'm really nervous about the patch. Its writing, blindly loading, > executing and deleting the library files from what I assume is a public > temporary directory on the system in a fashion thats transparent to the > user. Everything about that just sends flags off here saying don't do > that. > ... > This is the code I looked at last year and again now. There has to be a > more secure way of doing that. So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does anyone see security problems with that one? (message archived at http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else tried it? I can't say I have (yet). More files to install == more complexity and more work for the human or automated installer, and higher probability of version skew and conflicts with other installations. Having all of RXTX in one or two (portable part + platform specific) jar files probably allows the option of using Java Web Start for a "one click" installation or update. -- Mark Polhamus From taj at www.linux.org.uk Wed Mar 16 21:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 17 Mar 2005 04:05:28 +0000 (GMT) Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BE23.6050107@earthlink.net> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: On Wed, 16 Mar 2005, Mark Polhamus wrote: > Trent Jarvi wrote: > > > I'm really nervous about the patch. Its writing, blindly loading, > > executing and deleting the library files from what I assume is a public > > temporary directory on the system in a fashion thats transparent to the > > user. Everything about that just sends flags off here saying don't do > > that. > > ... > > This is the code I looked at last year and again now. There has to be a > > more secure way of doing that. > > So what about the classpath approach posted Feb. 26 by Chris Gaffney? Does > anyone see security problems with that one? (message archived at > http://marc.theaimsgroup.com/?l=rxtx&m=110944514207921&w=2) Has anyone else > tried it? I can't say I have (yet). > > More files to install == more complexity and more work for the human or > automated installer, and higher probability of version skew and conflicts with > other installations. > > Having all of RXTX in one or two (portable part + platform specific) jar files > probably allows the option of using Java Web Start for a "one click" > installation or update. > > Hi Mark I had forgotten about this patch. I obviously have not done something like this so any input is appreciated. The usual way things are done here is an application install puts its own copy of rxtx in its own copy of java. The exact opposite of what we are looking at here. This patch would allow a person to have a private directory so many of our concerns would no longer exist that the java temporary directory raised. But could it even do a little more? I have not tried this patch. I'm wondering if this couldnt find the library from inside the jar so there would be no reason to write files to the system drive at all. I could picture a jar with: gnu/io/*.class os.name/os.arch/*.so os.name/os.arch/*.dll The LoadLib could search its classpath (which jars are in) for String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch") String slash = System.getProperty("file.separator"); URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + "rxtxSerial.dll"); I just hardcoded the rxtxSerial.dll to give the idea. There is more logic to handle that right in Chris Gaffney's email you link. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Wed Mar 16 22:14:39 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Thu, 17 Mar 2005 16:14:39 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> Message-ID: <4239123F.4020301@phasefale.com.au> >I have not tried this patch. I'm wondering if this couldnt find the >library from inside the jar so there would be no reason to write files to >the system drive at all. > >I could picture a jar with: > >gnu/io/*.class >os.name/os.arch/*.so >os.name/os.arch/*.dll > >The LoadLib could search its classpath (which jars are in) for > >String os = System.getProperty("os.name"); >String arch = System.getProperty("os.arch") >String slash = System.getProperty("file.separator"); >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash + > "rxtxSerial.dll"); > >I just hardcoded the rxtxSerial.dll to give the idea. There is more logic >to handle that right in Chris Gaffney's email you link. > > > Unfortunately there is one downside to that patch it has to do with System.load(libURL.getFile()); System.load requires an absolute path and this fails when you try to get it from a jar. I got this Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so at java.lang.Runtime.load0(Runtime.java:734) at java.lang.System.load(System.java:811) at gnu.io.LibLoader2.loadLibrary(Unknown Source) at gnu.io.Play.main(Unknown Source) I've been doing a fair amount of research into the dll in jars problem today. So far I have found that there are plenty of ways to select the correct library file for the platform (but we knew this). Most of the solutions involve dumping the library file to the file system and then loading it. The one interesting thing I found was that it is possible deploy apps using Java Web Start when the application requires a native library. It seems like it would be possible to do this with rxtx too, it all boils down the the "nativelib" tag in the JNLP file. For the complete story http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws What I'm interested in at the moment is how web start handles the native libraries, maybe it does copy these to the clients file system. Unfortunately I don't have a system setup to test web start as outlined in the above URL so its taking a little more time. I did think of one possibility for checking if the library file if it is written to a temp dir. If the temp file was compared against the library file in the jar after it had been loaded then you could tell if it had been modified. Problem is the 'on load' of the dodgey library would have been executed and its closing the gate after the horse has bolted. I'm not aware of anyway to stop this, but I thought I'd suggest it in case someone with more knowledge of JNI knows if its possible. -- Peter Cain Senior Programmer Phasefale Pty Ltd From dmarkman at mac.com Thu Mar 17 07:45:08 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Thu, 17 Mar 2005 09:45:08 -0500 Subject: [Rxtx] RXTX Bundling In-Reply-To: References: Message-ID: <5c91ac986d233508fa72ec9bd7b264eb@mac.com> webstart it will deploy native libraries that's no problem here is a fragment of the multiplatform jnlp don't worry about loader.jar (it's our library) libnative.lib.jar is a jar that should be signed and should contain native libraries here is a shell script to do so: jar cf libnative.lib.jar .dll .dll jarsigner -keystore -storepass libnative.lib.jar problem with webstart on mac os x at least that jnilib isn't enough you have to setup permissions and groups you can do that too via Runtime.exec call to launch appropriate shell script On Mar 17, 2005, at 12:14 AM, Java RXTX discussion wrote: > > > >I have not tried this patch. ?I'm wondering if this couldnt find the > >library from inside the jar so there would be no reason to write > files to > >the system drive at all. > > > >I could picture a jar with: > > > >gnu/io/*.class > >os.name/os.arch/*.so > >os.name/os.arch/*.dll > > > >The LoadLib could search its classpath (which jars are in) for > > > >String os = System.getProperty("os.name"); > >String arch = System.getProperty("os.arch") > >String slash = System.getProperty("file.separator"); > >URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash > + > >???????"rxtxSerial.dll"); > > > >I just hardcoded the rxtxSerial.dll to give the idea. ?There is more > logic > >to handle that right in Chris Gaffney's email you link. > > > > ? > > > Unfortunately there is one downside to that patch it has to do with > > > System.load(libURL.getFile()); > > > System.load requires an absolute path and this fails when you try to > get > it from a jar. ?I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an > absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > ????????at java.lang.Runtime.load0(Runtime.java:734) > ????????at java.lang.System.load(System.java:811) > ????????at gnu.io.LibLoader2.loadLibrary(Unknown Source) > ????????at gnu.io.Play.main(Unknown Source) > > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). ?Most of the > solutions involve dumping the library file to the file system and then > loading it. > > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > ?It > seems like it would be possible to do this with rxtx too, it all boils > down the the "nativelib" tag in the JNLP file. ?For the complete story > http://www-106.ibm.com/developerworks/java/library/os-jws/? > open&ca=dgr-jw17os-jws > > > What I'm interested in at the moment is how web start handles the > native > libraries, maybe it does copy these to the clients file system. ? > Unfortunately I don't have a system setup to test web start as > outlined > in the above URL so its taking a little more time. > > > I did think of one possibility for checking if the library file if it > is > written to a temp dir. ?If the temp file was compared against the > library file in the jar after it had been loaded then you could tell > if > it had been modified. ?Problem is the 'on load' of the dodgey library > would have been executed and its closing the gate after the horse has > bolted. ?I'm not aware of anyway to stop this, but I thought I'd > suggest > it in case someone with more knowledge of JNI knows if its possible. > > > -- > Peter Cain > Senior Programmer > Phasefale Pty Ltd > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From nino at nordman.org Thu Mar 17 07:49:23 2005 From: nino at nordman.org (Nils Nordman) Date: Thu, 17 Mar 2005 15:49:23 +0100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4238BCB8.7000504@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> Message-ID: <20050317144923.GB12339@resourcing.se> On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > None of the reasons justify introducing security issues. But I don't > see the possible extra complexity would justify not going with a > "LibLoader" type solution, considering it wouldn't really affect the > core functionality of the library. Well, I'm obviously not against any solution that helps with deployment per se - if it can be handled transparently and without introducing any issues (security-related or otherwise) I'm all for it. But when it comes to writing and deleting files, well, that's just not something the library should do IMHO. If that's needed (the copying and deleting that is) I believe the application should see to it and cope with any issues. It's a library, why should it concern itself overly with the deployment of the application? Doesn't exactly give me that "clean-solution" feeling. Cheers, -- Nils Nordman From mario.sonnessa at urmet.it Wed Mar 16 09:53:18 2005 From: mario.sonnessa at urmet.it (Sonnessa Mario - URMET) Date: Wed, 16 Mar 2005 17:53:18 +0100 Subject: [Rxtx] Problem with send a particular messages Message-ID: <4238647E.2020305@urmet.it> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050316/00278648/attachment-0023.html From p.cain at phasefale.com.au Thu Mar 17 16:11:58 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:11:58 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <4239123F.4020301@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <4238BE23.6050107@earthlink.net> <4239123F.4020301@phasefale.com.au> Message-ID: <423A0EBE.6010808@phasefale.com.au> Peter Cain wrote: > >> I have not tried this patch. I'm wondering if this couldnt find the >> library from inside the jar so there would be no reason to write >> files to >> the system drive at all. >> >> I could picture a jar with: >> >> gnu/io/*.class >> os.name/os.arch/*.so >> os.name/os.arch/*.dll >> >> The LoadLib could search its classpath (which jars are in) for >> >> String os = System.getProperty("os.name"); >> String arch = System.getProperty("os.arch") >> String slash = System.getProperty("file.separator"); >> URL libURL = ClassLoader.getSystemResource(os + slash + arch + slash >> + "rxtxSerial.dll"); >> I just hardcoded the rxtxSerial.dll to give the idea. There is more >> logic to handle that right in Chris Gaffney's email you link. >> >> >> > Unfortunately there is one downside to that patch it has to do with > > System.load(libURL.getFile()); > > System.load requires an absolute path and this fails when you try to > get it from a jar. I got this > Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting > an absolute path of the library: > file:/home/pete/workspace/RXTXBundle/RXTXbundle.jar!/librxtxSerial.so > at java.lang.Runtime.load0(Runtime.java:734) > at java.lang.System.load(System.java:811) > at gnu.io.LibLoader2.loadLibrary(Unknown Source) > at gnu.io.Play.main(Unknown Source) > > I've been doing a fair amount of research into the dll in jars problem > today. So far I have found that there are plenty of ways to select the > correct library file for the platform (but we knew this). Most of the > solutions involve dumping the library file to the file system and then > loading it. > > The one interesting thing I found was that it is possible deploy apps > using Java Web Start when the application requires a native library. > It seems like it would be possible to do this with rxtx too, it all > boils down the the "nativelib" tag in the JNLP file. For the complete > story > http://www-106.ibm.com/developerworks/java/library/os-jws/?open&ca=dgr-jw17os-jws > Just to follow follow up on this, albeit slightly off topic. Java Web Start extracts the libraries specified with the tag from the jar puts them in a directory and them it must modify java.library.path add that dir. So it seems copying the native dirs out of jars to the file system is the 'the way its done'. -- Peter Cain Senior Programmer Phasefale Pty Ltd From p.cain at phasefale.com.au Thu Mar 17 16:17:13 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 10:17:13 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <20050317144923.GB12339@resourcing.se> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> Message-ID: <423A0FF9.8010900@phasefale.com.au> Nils Nordman wrote: >On Thu, Mar 17, 2005 at 10:09:44AM +1100, Peter Cain wrote: > > > > >>None of the reasons justify introducing security issues. But I don't >>see the possible extra complexity would justify not going with a >>"LibLoader" type solution, considering it wouldn't really affect the >>core functionality of the library. >> >> > >Well, I'm obviously not against any solution that helps with deployment >per se - if it can be handled transparently and without introducing >any issues (security-related or otherwise) I'm all for it. > >But when it comes to writing and deleting files, well, that's just not >something the library should do IMHO. If that's needed (the copying and >deleting that is) I believe the application should see to it and cope >with any issues. It's a library, why should it concern itself overly >with the deployment of the application? Doesn't exactly give me that >"clean-solution" feeling. > > A good point. In light of that maybe the best way go would be something like this * Leave the rxtx library alone. * Under contrib/ or some spot on the web, give the details on how to bundle rxtx library (see attached Ant script) should you wish to do so including the source for a LibLoader class (there are several version around). * Modify LibLoader so that a user has the option to specify some other directory other than a public temp dir (making it slightly more secure) * Outline the risks involved with the solution. Doing this doesn't upset the cleanliness of rxtx as a library but does share a solution for using/deploying the library. I guess it raises the question is this the kind of thing that should be closely related to rxtx (ie in the contrib dir) or more distantly on source forge or somewhere else. Anyway thats just an idea. I should point out he Ant script isn't quite a finished and provides two ways to create a bundle, without LibLoader would be more suitable to a Java Web Start type use. -- Peter Cain Senior Programmer Phasefale Pty Ltd -------------- next part -------------- A non-text attachment was scrubbed... Name: build.xml Type: text/xml Size: 4677 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050318/2fd0fce6/build-0014.xml From taj at www.linux.org.uk Thu Mar 17 19:39:41 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 18 Mar 2005 02:39:41 +0000 (GMT) Subject: [Rxtx] Problem with send a particular messages In-Reply-To: <4238647E.2020305@urmet.it> References: <4238647E.2020305@urmet.it> Message-ID: On Wed, 16 Mar 2005, Sonnessa Mario - URMET wrote: > I send a SHORT MESSAGE by Modem GSM and RxTxComm libraries. I execute the > following rows for them: > > TX: AT+CMGF=1 > RX: OK > TX: AT+CMGS=3384412808 > RX: > > TX: My Test SMS > TX: CTRL_Z > RX: +CMGS: 93 > > OK > > When i send a CTRL_Z? byte, after the text, for send the message, I don't > receive the response: "+CMGS: 93...". and so I mustn't send a message. > Is there a problem of transmitting a byte CTRL_Z (0x26 or unicode > "\u001a") ? > > Thanks in advance !!! > > > Control Z in a terminal suspends a program. There isnt enough here to know whats going on but you may have just suspended your other end. -- Trent Jarvi taj at www.linux.org.uk From p.cain at phasefale.com.au Fri Mar 18 00:01:16 2005 From: p.cain at phasefale.com.au (Peter Cain) Date: Fri, 18 Mar 2005 18:01:16 +1100 Subject: [Rxtx] RXTX Bundling In-Reply-To: <423A0FF9.8010900@phasefale.com.au> References: <4236777D.2040306@phasefale.com.au> <20050315074918.GA19378@resourcing.se> <4238BCB8.7000504@phasefale.com.au> <20050317144923.GB12339@resourcing.se> <423A0FF9.8010900@phasefale.com.au> Message-ID: <423A7CBC.1020604@phasefale.com.au> Peter Cain wrote: >> >> > A good point. In light of that maybe the best way go would be > something like this > * Leave the rxtx library alone. I've just realized there is a hole in my plan and its not possible to leave RXTX alone when loading native libs from jars. About the best solution my brain can come up with late on a Friday afternoon is to have rxtx attempt a fall back library load if it can't find the library on the java.library.path. For example: public class SomeClass { static { try { System.loadLibrary("rxtxSerial"); } catch (UnsatisfiedLinkError e) { try { Class c = Class.forName("gnu.io.LibLoader"); Constructor cs = c.getConstructor(new Class[] { String.class }); Object o = cs.newInstance(new Object[] { "rxtxSerial" }); } catch (Throwable t) { // Obviously it doesn't exist so let the re-throw the original error throw e; } } } } So if a gnu.io.LibLoader exists on the class path its constructor is used to extract library from inside the jar. It also means the gnu.io.LibLoader doesn't come with rxtx it is supplied outside of the library, almost like a plugin to find native libs. I'm not convinced myself how good an idea this really is and I haven't checked to see if this has been suggested before (apologies if it has). So I won't be offended if it gets "canned" :) I'm almost ready to find another solution to this problem. -- Peter Cain Senior Programmer Phasefale Pty Ltd From jimo at earthlink.net Tue Mar 22 00:11:27 2005 From: jimo at earthlink.net (Jim Owen) Date: Mon, 21 Mar 2005 23:11:27 -0800 Subject: [Rxtx] Error under RedHat Message-ID: Hi, I'm wondering if anyone can help me with a problem under linux. I installed rxtx on a RedHat system using an older version of RXTX - 1.4, which ran a comm port enumeration test program without problem. When I went to run my application, I got an "Illegal use of nonvirtual function call" error which caused the program to terminate. I then installed the 2.0-7 pre1 distribution and received a different error related to missing link libraries, although the libraries were installed in the same place as the 1.4 versions. The error was "UnsatisfiedLinkError: no Serial in java.library.path while loading driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" I went ahead and tried the 2.1-17 distribution as well, and essentially got the same error. Any ideas on this one? Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050321/b8f8b4f3/attachment-0014.html From taj at www.linux.org.uk Tue Mar 22 00:33:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 07:33:19 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX - > 1.4, which ran a comm port enumeration test program without problem. When I > went to run my application, I got an "Illegal use of nonvirtual function > call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a different > error related to missing link libraries, although the libraries were > installed in the same place as the 1.4 versions. The error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading driver > gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk From bst_co at yahoo.com Tue Mar 22 12:40:11 2005 From: bst_co at yahoo.com (bst) Date: Tue, 22 Mar 2005 11:40:11 -0800 (PST) Subject: [Rxtx] Java System properties overridden by RXTX Message-ID: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Hi, I downloaded the latest version RXTX-2.1-7pre20 and it still overrides System properties System.setProperties(p); See http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 Hope it helps __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From taj at www.linux.org.uk Tue Mar 22 13:36:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Mar 2005 20:36:05 +0000 (GMT) Subject: [Rxtx] Java System properties overridden by RXTX In-Reply-To: <20050322194011.12508.qmail@web50407.mail.yahoo.com> References: <20050322194011.12508.qmail@web50407.mail.yahoo.com> Message-ID: On Tue, 22 Mar 2005, bst wrote: > Hi, > > I downloaded the latest version RXTX-2.1-7pre20 > and it still overrides System properties > System.setProperties(p); > > See > http://marc.theaimsgroup.com/?l=rxtx&m=109388238125712&w=2 > > Hope it helps > Thanks for the reminder. I'll put the patch into CVS. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Tue Mar 22 22:46:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Tue, 22 Mar 2005 21:46:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, Thanks for the reply. I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified that all the shared libraries are in the correct location - jre/lib/i386 and that the javax.comm.properties contains the single entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: Caught java.lang.UnsatisfiedLinkError: no Serial 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 It appears to be attempting to load the gnu.io.RXTXCommDriver, yet still gives an error for Solaris. Any ideas? Thanks, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, March 21, 2005 11:33 PM To: Java RXTX discussion Subject: Re: [Rxtx] Error under RedHat On Mon, 21 Mar 2005, Jim Owen wrote: > Hi, > > I'm wondering if anyone can help me with a problem under linux. > > I installed rxtx on a RedHat system using an older version of RXTX > - 1.4, which ran a comm port enumeration test program without problem. > When I went to run my application, I got an "Illegal use of nonvirtual > function call" error which caused the program to terminate. Hi Jim Java caught rxtx doing things wrong here. As I recall this is caused by declaring inner class methods as private instead of protected. So you can change the code even with a search and replace. Some JREs also allow you to get past this issue by passing -noverify to java The problem is somewhat cosmetic in nature but rxtx was wrong. > > I then installed the 2.0-7 pre1 distribution and received a > different error related to missing link libraries, although the > libraries were installed in the same place as the 1.4 versions. The > error was > "UnsatisfiedLinkError: no Serial in java.library.path while loading > driver gnu.io.RXTXCommDriver" and "no SolarisSerialParallel in java.library.path" No SolarisSerialParallel means CommAPI is trying to load the Sun native library not the RXTX native library. It would appear there is a problem with your javax.comm.properties file which should contain only the line: Driver=gnu.io.RXTXCommDriver and should be located in ...jre/lib/javax.comm.properties -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 03:32:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 10:32:28 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk From trevor at opecsystem.com Wed Mar 23 05:03:18 2005 From: trevor at opecsystem.com (Trevor Sutton) Date: Wed, 23 Mar 2005 12:03:18 -0000 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: <000d01c52fa0$588b8aa0$64001eac@aries> I had the same problem with Suse linux after moving to 2.1.7. I tracked it down to an import javax.comm statement in a class which had no requirement for the import any way, probably a cut&paste job. Hope that helps Trevor Sutton; Managing Director OpecSystem Limited Mobile 07768 461940 Office 01296 730110 Email Trevor at opecsystem.com www. opecsystem.com -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: 23 March 2005 10:32 To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - jre/lib/i386 and > that the javax.comm.properties contains the single entry for > Driver=gnu.io.RXTXCommDriver and I've made sure that the RXTXcomm.jar file > is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Mar 23 05:23:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 12:23:17 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: <000d01c52fa0$588b8aa0$64001eac@aries> References: <000d01c52fa0$588b8aa0$64001eac@aries> Message-ID: On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which had > no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk From s022518 at student.dtu.dk Wed Mar 23 09:29:06 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:29:06 +0100 Subject: [Rxtx] Mac OS X 10.3.8 Message-ID: <42419952.2050707@student.dtu.dk> I'm compiling rxtx-2.1-CVS-20050120 and rxtx-2.1-7pre17 under Mac OS X 10.3.8. And I've got issues. It seems as if some of the modifications in configure.in don't get applied to Makefile. Specifically: 1) abs_srcdir = $(TOP)/. the /. is superflous 2) make you get an error because the compiling is looking for SerialImp.o in powerpc-apple-darwin7.8.0 while the compiling process has generated SerialImp.lo Renaming and then running 'make' again solved this problem 3) librxtxSerial.jnilib the compiling generates libSerial.jnilib instead This mailing list was of great help in dealing with these issues :-) Otherwise, it's working perfectly ! My buddies and I are using it in conjunction with this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- without any problems under Mac OS X keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From jimo at earthlink.net Wed Mar 23 09:32:56 2005 From: jimo at earthlink.net (Jim Owen) Date: Wed, 23 Mar 2005 08:32:56 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Thanks to both of you. I should be able to sort this out with your hints. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 4:23 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Wed, 23 Mar 2005, Trevor Sutton wrote: > I had the same problem with Suse linux after moving to 2.1.7. > > I tracked it down to an import javax.comm statement in a class which > had no requirement for the import any way, probably a cut&paste job. > > Hope that helps > I just verified that there is no reference to javax.comm in the 2.1.7pre17 source code. The user application would still need to replace "import javax.comm.*"; with "import gnu.io.*;" however. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From s022518 at student.dtu.dk Wed Mar 23 09:33:03 2005 From: s022518 at student.dtu.dk (Bjarne Mathiesen) Date: Wed, 23 Mar 2005 17:33:03 +0100 Subject: [Rxtx] available ports under Windows XP Message-ID: <42419A3F.3030504@student.dtu.dk> My buddies and I are using this little thingy: http://www.byterunner.com/byterunner/product=name:USB-8COM- Now, when you are adding this to a PC that's already gotten a board with 2 serial ports, rxtx is only able to see and use the first 9 ports even though XP sees all 10 keep up the good work :-) -- Bjarne D Mathiesen mailto:s022518 at student.dtu.dk DK-2200 K?benhavn N ; Danmark ; Europa ---------------------------------------------------------------------- denne besked er skrevet i et totalt M$/Intel-frit milj? MacOS X 10.3.8 Panther ; Mozilla 1.7.5 ; PowerPC G4 800MHz http://dtu.mathiesen.info/ http://mozilla.mathiesen.info/ http://webadmin.mathiesen.info/ From taj at www.linux.org.uk Wed Mar 23 13:50:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Mar 2005 20:50:24 +0000 (GMT) Subject: [Rxtx] available ports under Windows XP In-Reply-To: <42419A3F.3030504@student.dtu.dk> References: <42419A3F.3030504@student.dtu.dk> Message-ID: On Wed, 23 Mar 2005, Bjarne Mathiesen wrote: > My buddies and I are using this little thingy: > http://www.byterunner.com/byterunner/product=name:USB-8COM- > > Now, when you are adding this to a PC that's already gotten a board with > 2 serial ports, rxtx is only able to see and use the first 9 ports even > though XP sees all 10 > Hi Bjarne When rxtx enumerates ports on Windows, it looks for the first 256 ports. rxtx will try to open the port and performed a timed out read just to see if the OS returns a real error. In RXTXCommDriver.java, you may try to have rxtx scan "//./COM" instead of "COM" I dont know if this is the problem for sure. I reading something about that with multiport cards. There isnt anything hard coded to 9 ports for XP that I know of but I remember there may be a problem with using COM10 vs //./COM10. The strange thing is I remember trying large port numbers like COM128 on XP and it worked at one point. You can reassign the port numbers so I was just testing with a two port system. You could try reassigning some ports in the COM11-16 range just to see whats going on. The other thing you can try is just verifying that you can read from the port with a terminal program. Perhaps XP mentions the port but for some reason rxtx can not read from the port for real reasons. Windows CE only tries the only first 8 ports. -- Trent Jarvi taj at www.linux.org.uk From jimo at earthlink.net Thu Mar 24 23:43:53 2005 From: jimo at earthlink.net (Jim Owen) Date: Thu, 24 Mar 2005 22:43:53 -0800 Subject: [Rxtx] Error under RedHat In-Reply-To: Message-ID: Hi Trent, I've been through a bit of a saga since the last email and could use a few more hints. I successfully installed the 2.1 version, but unfortunately, the third party software that we're using references javax.comm throughout and we don't have access to the source. (I was able to run the port enumeration test program without a hitch which told me the install was correct.) So I uninstalled the 2.1 version and started installing the 2.0 version. When I attempted to run the port enumeration program, I received an error that appears to have come from the librxtxSerial.so library. The error was as follows: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xB75F517D Function=_dl_relocate_object+0x6D Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0xaaec0270> (a java.util.Vector) - locked <0xaaedb728> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xaaed4320> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:44) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:67) at VerifyCommBuild.main(VerifyCommbuild.java:20) After receiving this error, I decided to simply rebuild it on my system. After running autoconf, I executed ./configure, which had only one warning during execution that the kernal include files did not match the current kernel. Otherwise, all was okay. When executing make install, compilation of SerialImp.c fails with a lot of errors. First is in the include of SerialImp.h: syntax error before "tcflag_t"... Other errors continue througout the compliation, mostly of syntax of type declarations missing. Do you have any thoughts on where I should take this now? Appreciate your help. Regards, Jim -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Wednesday, March 23, 2005 2:32 AM To: Java RXTX discussion Subject: RE: [Rxtx] Error under RedHat On Tue, 22 Mar 2005, Jim Owen wrote: > Hi Trent, > > Thanks for the reply. > > I'm a bit puzzled still on the 2.1-7pre17 problem. I've verified > that all the shared libraries are in the correct location - > jre/lib/i386 and that the javax.comm.properties contains the single > entry for Driver=gnu.io.RXTXCommDriver and I've made sure that the > RXTXcomm.jar file is in the jre/lib/ext directory, yet I still get the following error: > > Caught java.lang.UnsatisfiedLinkError: no Serial 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 > > It appears to be attempting to load the gnu.io.RXTXCommDriver, yet > still gives an error for Solaris. > Hi Jim, With rxtx 2.1, there is no need for Sun's CommAPI but the classes are in package gnu.io not javax.comm. So it appears you have a copy of Sun's comm.jar in your classpath perhaps from earlier attempts at install. So I would try to clean things up. Hunt down the following jars if they are installed and delete them. comm.jar jcl.jar RXTXcomm.jar. They are probably in ...java/jre/lib/ext Then install the RXTXcomm.jar you want in your classpath. The jre/lib/ext directory will work. Last install the native lisbs which should be called librxtxSerial.so and librxtxParallel.so in ...java/jre/lib/i386/ If rxtx 2.1 is installed properly and Sun's comm.jar is properly removed, there will never by an attempt to load SolarisSerialParallel. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Mar 25 00:27:38 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Mar 2005 07:27:38 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Thu, 24 Mar 2005, Jim Owen wrote: > > After receiving this error, I decided to simply rebuild it on my > system. After running autoconf, I executed ./configure, which had only one > warning during execution that the kernal include files did not match the > current kernel. Otherwise, all was okay. > > When executing make install, compilation of SerialImp.c fails with a > lot of errors. First is in the include of SerialImp.h: syntax error before > "tcflag_t"... > > Other errors continue througout the compliation, mostly of syntax of > type declarations missing. > > Do you have any thoughts on where I should take this now? > This sounds like a missing include file. Could you email the results of the following to me off the mail-list? script which java java -version echo $JAVA_HOME tar -xzf rxtx-2.0-CVS-20050120.tar.gz cd rxtx-2.0-CVS-20050120 mkdir build cd build ../configure make exit The results will be in a file called typescript. I suspect the error shows up earlier than the "syntax error before tcflag_t." -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Mar 25 19:21:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Mar 2005 02:21:21 +0000 (GMT) Subject: [Rxtx] Error under RedHat In-Reply-To: References: Message-ID: On Fri, 25 Mar 2005, Jim Owen wrote: > Hi Trent, > > Here's the typescript file. The exact commands that you gave didn't > work for my installation, so I went ahead and executed the configure and > make in the directory I'm using. > > Here you go. > > Thanks, > > Jim > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On > Behalf Of Trent Jarvi > Sent: Thursday, March 24, 2005 11:28 PM > To: Java RXTX discussion > Subject: RE: [Rxtx] Error under RedHat > > On Thu, 24 Mar 2005, Jim Owen wrote: > > > > After receiving this error, I decided to simply rebuild it on my > > system. After running autoconf, I executed ./configure, which had only > > one warning during execution that the kernal include files did not > > match the current kernel. Otherwise, all was okay. > > > > When executing make install, compilation of SerialImp.c fails with a > > > lot of errors. First is in the include of SerialImp.h: syntax error > > before "tcflag_t"... > > > > Other errors continue througout the compliation, mostly of syntax of > > > type declarations missing. > > > > Do you have any thoughts on where I should take this now? > > > > This sounds like a missing include file. Could you email the results of the > following to me off the mail-list? > > script > > which java > java -version > echo $JAVA_HOME > tar -xzf rxtx-2.0-CVS-20050120.tar.gz > cd rxtx-2.0-CVS-20050120 > mkdir build > cd build > ../configure > make > > exit > > The results will be in a file called typescript. I suspect the error shows > up earlier than the "syntax error before tcflag_t." > All the problems I can see appear to be because you did not include /usr/include/bits/termios.h. This is obtained by the macro: #include This file is /usr/include/termios.h which in term includes bits/termios.h When you run configure, there is a config.h file created that should have the line #define HAVE_TERMIOS_H 1 If you look in the top of SerialImp.c it has code that does something along the lines of: #ifdef HAVE_TERMIOS_H # include #endif Your typescript was not using a clean tarball as you ignored the tar error messages. I don't know if config.h is incorrect, the SerialImp.c file has been improperly modified or if your system include files are not prestine. I'm looking here and the 2.0-7pre2 you downloaded does compile. At the very least I'd delete the directory you have been trying to get work and start with the tar file again. Force the include of termios.h and if that causes errors due to missing include files, you will have to examine what is wrong with your system include files. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Thu Mar 3 09:52:17 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri, 04 Mar 2005 01:52:17 +0900 Subject: [Rxtx] Was Rxtx ported on MIPS 32? Message-ID: <422740C1.4070902@connectedsys.com> I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . COMM within J9 is horrible. It miss data!!! Was RXTX ported on MIPS32? Is there MIPS 32 RXTX references? From moritz.gmelin at gmx.de Thu Mar 3 09:57:59 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 3 Mar 2005 17:57:59 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: Message-ID: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> There has been a previous patch that could do this from within the JAR Archive. Extract the native lib from the JAR, write it to a temporary file and load that file as a library. Could be added to your patch... M. Am 26.02.2005 um 20:11 schrieb Trent Jarvi: > > Anyone have a problem these changes? > > -- > Trent Jarvi > taj at www.linux.org.uk > > ---------- Forwarded message ---------- > Date: Sat, 26 Feb 2005 13:53:17 -0500 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Patch for Libraries on Classpath > > Hi, > > Included is a patch file that allows the libaries (e.g > librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath > instead of having to be included in java.library.path. > > I am using RXTX for my senior project but didn't have access to > install the libraries so I created this little fix. > > I hope others can find it useful. > > -Chris Gaffney > Grand Valley State University.diff -Naur > rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java 2003-02-18 > 06:51:20.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java 2005-02-26 > 13:35:02.821332008 -0500 > > @@ -80,7 +80,7 @@ > > if (debug) > > System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > } > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > } > > CommPortIdentifier ( String pn, CommPort cp, int pt, CommDriver > driver) > > { > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > --- rxtx-2.1-7pre17-orig/src/I2C.java 2002-04-05 12:05:15.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/I2C.java 2005-02-26 13:27:16.929158384 > -0500 > > @@ -35,7 +35,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxI2C" ); > > + LibLoader.loadLibrary( "rxtxI2C" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java 2002-11-25 > 16:57:42.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java 2005-02-26 13:27:55.928229624 > -0500 > > @@ -32,7 +32,7 @@ > > { > > > > static { > > - System.loadLibrary( "rxtxParallel" ); > > + LibLoader.loadLibrary( "rxtxParallel" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java 1969-12-31 > 19:00:00.000000000 -0500 > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java 2005-02-26 > 13:38:38.578531928 -0500 > > @@ -0,0 +1,68 @@ > > +/* > > + * LibLoader.java > > + * > > + * Created on February 26, 2005, 1:03 PM > > + */ > > + > > +package gnu.io; > > + > > +import java.net.URL; > > +import java.util.HashSet; > > +import java.util.Locale; > > +import java.util.Set; > > + > > +/** > > + * Package specific class for allowing the loading of libraries from > the > > + * classpath. This class uses some RXTX specific conventions so it > would require > > + * some modifications for use in other software. > > + * @author Chris Gaffney > > + */ > > +class LibLoader { > > + /** Set of loaded libaries. */ > > + private static final Set loaded = new HashSet(); > > + > > + /** This is a static class so lets not let it be instantiated. */ > > + private LibLoader() {} > > + > > + public static void loadLibrary(String lib) { > > + if(loaded.contains(lib)) { > > + // Library is already loaded so just exit. > > + return; > > + } > > + > > + // Lets try to load the library. > > + try { > > + // Try to load the library through regular channels. > > + System.loadLibrary(lib); > > + } catch (UnsatisfiedLinkError e) { > > + // Load has failed so we attempt to locate the library > > + // on the classpath > > + String fileName = lib + "."; > > + > > + String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > + if(os.equals("windows")) { > > + // Windows. > > + fileName += "dll"; > > + } else { > > + fileName = "lib" + fileName + "so"; > > + } > > + > > + URL libURL = ClassLoader.getSystemResource(fileName); > > + //URL libURL = > getClass().getClassLoader().getResource(fileName); > > + > > + if(libURL == null) { > > + // If we couldn't find it on the classpath so throw > the original > > + // exception. > > + throw e; > > + } else { > > + // File exists so lets load it. If it fails then we > just let the > > + // exception be thrown to the parent class. > > + System.load(libURL.getFile()); > > + } > > + } > > + > > + // If we made it here then everything went well so mark the > library as > > + // loaded. > > + loaded.add(lib); > > + } > > +} > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > --- rxtx-2.1-7pre17-orig/src/RS485.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/RS485.java 2005-02-26 13:28:09.916103144 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRS485" ); > > + LibLoader.loadLibrary( "rxtxRS485" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java 2005-02-26 > 13:28:27.427441016 -0500 > > @@ -41,7 +41,7 @@ > > static > > { > > if(debug ) System.out.println("RXTXCommDriver {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > > > /* > > Perform a crude check to make sure people don't mix > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java 2003-07-17 > 22:20:26.000000000 -0400 > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java 2005-02-26 > 13:28:47.677362560 -0500 > > @@ -51,7 +51,7 @@ > > > > if(debug ) > > z.reportln( "RXTXPort {}"); > > - System.loadLibrary( "rxtxSerial" ); > > + LibLoader.loadLibrary( "rxtxSerial" ); > > Initialize(); > > } > > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > --- rxtx-2.1-7pre17-orig/src/Raw.java 2002-04-05 12:05:16.000000000 > -0500 > > +++ rxtx-2.1-7pre17-mod/src/Raw.java 2005-02-26 13:29:05.616635376 > -0500 > > @@ -32,7 +32,7 @@ > > > > static > > { > > - System.loadLibrary( "rxtxRaw" ); > > + LibLoader.loadLibrary( "rxtxRaw" ); > > Initialize(); > > } > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Thu Mar 3 12:32:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 19:32:44 +0000 (GMT) Subject: [Rxtx] Was Rxtx ported on MIPS 32? In-Reply-To: <422740C1.4070902@connectedsys.com> References: <422740C1.4070902@connectedsys.com> Message-ID: On Fri, 4 Mar 2005, Jisung, Ahn wrote: > I use MIPS 32, Linux 2.4 and J9(v 2.0) on my company . > > COMM within J9 is horrible. It miss data!!! > > Was RXTX ported on MIPS32? > > Is there MIPS 32 RXTX references? > I'm sure this can work but how do you normally build C programs for your MIPS system? Is the compiler on the mips machine or do you cross compile? I have a openwrt wireless box with mips that uses a cross tool chain because it really does not have the space for anything. Is this what you do too? There are many linux systems like this that can work but just need tinkering to build. MIPS, ARM, ... If you are trying to build on the system, email me a typescript of the configure and make output off the list and I can then fix any problems with he build. It may even just work though I suspect I need to see that configure output to see how J9 reports itself. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Mar 3 14:57:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 3 Mar 2005 21:57:08 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: On Thu, 3 Mar 2005, Moritz Gmelin wrote: > There has been a previous patch that could do this from within the JAR > Archive. > > Extract the native lib from the JAR, write it to a temporary file and > load that file as a library. > > Could be added to your patch... > > > M. > I had looked at the thread and thought there was a problem with making it work for some reason. I've now forgotten why. I'll look at it again. Did you get it to work on the various OS's? -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Mar 4 07:40:32 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Mar 2005 15:40:32 +0100 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) In-Reply-To: References: <2ee20fa4c5d091a444feea52dd58e784@gmx.de> Message-ID: <7665d10763379c0efd3b7c1149574e4b@gmx.de> It works with Linux, MacOS X, Windows and PocketPC. On Windows it'll leave the file after exiting the system which can cause a lot of garbage. M. Am 03.03.2005 um 22:57 schrieb Trent Jarvi: > On Thu, 3 Mar 2005, Moritz Gmelin wrote: > >> There has been a previous patch that could do this from within the JAR >> Archive. >> >> Extract the native lib from the JAR, write it to a temporary file and >> load that file as a library. >> >> Could be added to your patch... >> >> >> M. >> > > I had looked at the thread and thought the